
 var nbeport = {//nbeport美化滚动条
	run: function(){
		oScroll1 = $('#scrollbar1');
		if(oScroll1.length > 0){
			oScroll1.tinyscrollbar();
		}
		oScroll0 = $('#list');
		if(oScroll0.length > 0){
			oScroll0.tinyscrollbar();
		}		
	}
};
$(document).ready(function(){
	
 $("#head").append('<img src="theme/default/images/change/logo.jpg" />')//添加logo
 $("#mainbody").append('<a title="隐藏左侧菜单" class="control"></a>')//
 $('.control').height(adjustWindow());
 $('.controler').height(adjustWindow());
 var fullScreen=false;//检测浏览器当前状态
 
 
 $('.control').live('click', function() {
 var windowW=$(window).width();
 //var Rwidth =$(".r").width();
 $(this).remove();
  var m=windowW-15;
 $('.l').animate({left:"-234"},300,function(){$("#mainbody").append('<a title="显示左侧菜单" class="controler"></a>')});
 $('.r').animate({left:"13",width:m},300);
 $('.content').animate({width:m-7},300);
 $("#scrollbar1").find(".viewport").animate({width:m-27},300);
 fullScreen = true;
});

 $('.controler').live('click', function() {
 var windowW=$(window).width();
 //var Rwidth =$(".r").width();
 $(this).remove();
 var m=windowW-245;
 $('.l').animate({left:"0"},300,function(){$("#mainbody").append('<a title="隐藏左侧菜单" class="control"></a>')});
 $('.r').animate({left:"245",width:m},300);
 $('.content').animate({width:m-7},300);
 $("#scrollbar1").find(".viewport").animate({width:m-27},300);
 fullScreen = false;

});
 $(".txt").focus(function(){$(this).css({"border":"1px solid #0c7af3"})}).blur(function(){$(this).css({"border":"1px solid #cdcfce"})});

$(window).resize(function(){adjustWindow();nbeport.run();$('.control').height(adjustWindow());$('.controler').height(adjustWindow());});
adjustWindow();
function adjustWindow(){
var windowH=$(window).height();
var windowW=$(window).width();
var headH=$("#head").height();
if($(".nav").height()){var navH=$(".nav").height();}
var footerH=$("#footer").height();
if($(".l").find(".name").height())
{var nameH=$(".l").find(".name").height();}
else {nameH=0;}
//alert(nameH);
var listL=$(".list").find("a").length;
//alert(headH+navH+footerH)
var listH= windowH-headH-navH-footerH-nameH-20;
$(".list,.viewport").css({"height":listH});
$(".r,#mainbody").css({"height":listH+nameH});
$(".list").find(".viewport").css({"width":232});
if(!fullScreen){

$(".content").css({"width":windowW-252});
$("#scrollbar1").find(".viewport").css({"width":windowW-272});
$(".list").find(".viewport").css({"width":232});
//
if($(".list").height()<listL*29){$(".list").find(".viewport").css({"width":217});}
$(".r").css({"width":windowW-245});
return listH+nameH;

}
else
{
$(".content").css({"width":windowW-22});
$("#scrollbar1").find(".viewport").css({"width":windowW-42});
$(".list,.viewport").css({"height":listH});
$(".r,#mainbody").css({"height":listH+nameH});
$(".r").css({"width":windowW-15});
return listH+nameH;




}

}
$(".go").dialog({
 
    title: 'ILD 政务项目UI组件',
	width: 400,
	//fixed: true,
	lock: true,
	content: '可以写内容的弹窗'  
});
nbeport.run();
});